package com.cms.pictureslector

import android.content.Intent
import android.provider.MediaStore
import com.alibaba.android.arouter.facade.annotation.Route
import com.android.baselibrary.arouter.ArouterContains
import com.android.baselibrary.base.BaseActivity
import com.cms.pictureslector.databinding.PicutureSelectorActivityMainBinding

/**
 * AUTHOR：YF
 * DATE: 2024/1/15 0015
 * DESCRIBE:
 */
@Route(path = ArouterContains.PICTURE_SELECTOR)
class PictureSelectorMainActivity: BaseActivity<PicutureSelectorActivityMainBinding>() {
    override fun getLayoutId(): Int {
        return R.layout.picuture_selector_activity_main
    }

    override fun initView() {

    }

    override fun initListener() {
       mBinding.btnOpenCamera.setOnClickListener {
            openSystemCamera()
       }
    }
    private fun openSystemCamera(){
        val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
        packageManager?.let {
            if (intent.resolveActivity(it) !=null){
                startActivity(intent)
            }
        }
    }
}